package xyz.xtt.third.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.hutool.json.JSONUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import xyz.xtt.common.response.ApiResult;
import xyz.xtt.third.request.RoseOrderRequest;
import xyz.xtt.third.service.IRoseService;

/**
 * @author huqibo
 * @date 2024/12/28
 */
@Tag(name = "三方调用", description = "三方调用")
@RefreshScope
@Slf4j
@RestController
@RequestMapping("/api/nft/third")
public class ThirdController {
	@Autowired
	private IRoseService iRoseService;

	@Operation(summary = "三方玫瑰花订单")
	@PostMapping("/rose/make")
	public ApiResult<Boolean> make(@RequestBody RoseOrderRequest roseOrder) {
		log.info("/api/order/rose/make param:{}", JSONUtil.toJsonStr(roseOrder));
		Boolean thirdOrder = iRoseService.thirdOrder(roseOrder);
		return ApiResult.ok(thirdOrder);
	}
}
